package demo;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author liangzai
 * @Description:
 */
public class Training {
    //七边形
    public static void main1(String[] args) {
        long val = 1;
        long sum = 0;
        for (int i = 1; i <= 20240601; i++) {
            sum += val;
            val += 5;
            if(i == 10333333){
                System.out.println(sum);
            }
        }
        System.out.println(Long.MAX_VALUE);
        System.out.println(sum);
        System.out.println(1024204791742101l);
    }

    //分组
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] nums = new int[n+1];
//        int max = Integer.MIN_VALUE;
//        int min = Integer.MAX_VALUE;
        for (int i = 1; i <= n; i++) {
            int val = scanner.nextInt();
            nums[i] = val;
//            if(max<val) max = val;
//            if(min>val) min = val;
        }
        Arrays.sort(nums);
        if(nums[n]<=nums[1]*2) {
            System.out.println(0);
        }
        int count = 0;
        int left = 1;
        int right = 2;
        while (right <= n) {
            if(nums[left]*2<=nums[right]){
                right++;
                left++;
                count++;
            }else {
                right++;
            }
        }
        System.out.println(count);
        //宝塔
        System.out.println("4352115243243153215451432");
    }

    //美丽区间
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int K = scanner.nextInt();
        int T = scanner.nextInt();
        int max = Integer.MIN_VALUE;
        int[] nums = new int[T];
        for (int i = 0; i < T; i++) {
            nums[i] = scanner.nextInt();
            max = Math.max(max,nums[i]);
        }
        int[] nums2 = new int[max+10];
        int count = 1;
        int val = 1;
        while (true) {
            int right = val+K;
            while(gcd(val,right) != 1){
                right++;
            }
            Arrays.fill(nums2,val,right+1,count);
            if(right>=max){
                break;
            }
            val = right+1;
            count++;
        }
        for (int i = 0; i < T; i++) {
            System.out.println(nums2[nums[i]]);
        }
    }

    public static int gcd(int x,int y){
        return y%x==0 ? x : gcd(y%x,x);
    }

}








